package com.hundredapp.oa.domain;

import static javax.persistence.GenerationType.IDENTITY;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * OaStudent entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "oa_student", catalog = "oa_demo")
public class OaStudent implements java.io.Serializable {

	// Fields

	private Integer id;
	private String displayName;
	private String englishName;
	private Date birthDate;
	private String school;
	private String grade;
	private Integer age;
	private String mother;
	private String MMobile;
	private Integer MContactType;
	private String MContact;
	private String MWorking;
	private String MPosition;
	private String father;
	private String FMobile;
	private Integer FContactType;
	private String FContact;
	private String FWorking;
	private String FPosition;
	private String address;
	private String phone;
	private String emergency;
	private String relationship;
	private String EPhone;
	private Integer createUserId;
	private Timestamp createTime;
	private Integer sex;
	private List<OaContract> oaContracts = new ArrayList<OaContract>(0);
	private List<OaClass> oaClasses ;

	// Constructors

	/** default constructor */
	public OaStudent() {
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "display_name", length = 45)
	public String getDisplayName() {
		return this.displayName;
	}

	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}

	@Column(name = "english_name", length = 45)
	public String getEnglishName() {
		return this.englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "birth_date", length = 10)
	public Date getBirthDate() {
		return this.birthDate;
	}

	public void setBirthDate(Date birthDate) {
		this.birthDate = birthDate;
	}

	@Column(name = "school", length = 45)
	public String getSchool() {
		return this.school;
	}

	public void setSchool(String school) {
		this.school = school;
	}

	@Column(name = "grade", length = 45)
	public String getGrade() {
		return this.grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	@Column(name = "age")
	public Integer getAge() {
		return this.age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	@Column(name = "mother", length = 45)
	public String getMother() {
		return this.mother;
	}

	public void setMother(String mother) {
		this.mother = mother;
	}

	@Column(name = "m_mobile", length = 45)
	public String getMMobile() {
		return this.MMobile;
	}

	public void setMMobile(String MMobile) {
		this.MMobile = MMobile;
	}

	@Column(name = "m_contact_type")
	public Integer getMContactType() {
		return this.MContactType;
	}

	public void setMContactType(Integer MContactType) {
		this.MContactType = MContactType;
	}

	@Column(name = "m_contact", length = 45)
	public String getMContact() {
		return this.MContact;
	}

	public void setMContact(String MContact) {
		this.MContact = MContact;
	}

	@Column(name = "m_working", length = 45)
	public String getMWorking() {
		return this.MWorking;
	}

	public void setMWorking(String MWorking) {
		this.MWorking = MWorking;
	}

	@Column(name = "m_position", length = 45)
	public String getMPosition() {
		return this.MPosition;
	}

	public void setMPosition(String MPosition) {
		this.MPosition = MPosition;
	}

	@Column(name = "father", length = 45)
	public String getFather() {
		return this.father;
	}

	public void setFather(String father) {
		this.father = father;
	}

	@Column(name = "f_mobile", length = 45)
	public String getFMobile() {
		return this.FMobile;
	}

	public void setFMobile(String FMobile) {
		this.FMobile = FMobile;
	}

	@Column(name = "f_contact_type")
	public Integer getFContactType() {
		return this.FContactType;
	}

	public void setFContactType(Integer FContactType) {
		this.FContactType = FContactType;
	}

	@Column(name = "f_contact", length = 45)
	public String getFContact() {
		return this.FContact;
	}

	public void setFContact(String FContact) {
		this.FContact = FContact;
	}

	@Column(name = "f_working", length = 45)
	public String getFWorking() {
		return this.FWorking;
	}

	public void setFWorking(String FWorking) {
		this.FWorking = FWorking;
	}

	@Column(name = "f_position", length = 45)
	public String getFPosition() {
		return this.FPosition;
	}

	public void setFPosition(String FPosition) {
		this.FPosition = FPosition;
	}

	@Column(name = "address", length = 45)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "phone", length = 45)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "emergency", length = 45)
	public String getEmergency() {
		return this.emergency;
	}

	public void setEmergency(String emergency) {
		this.emergency = emergency;
	}

	@Column(name = "relationship", length = 45)
	public String getRelationship() {
		return this.relationship;
	}

	public void setRelationship(String relationship) {
		this.relationship = relationship;
	}

	@Column(name = "e_phone", length = 45)
	public String getEPhone() {
		return this.EPhone;
	}

	public void setEPhone(String EPhone) {
		this.EPhone = EPhone;
	}

	@Column(name = "create_user_id")
	public Integer getCreateUserId() {
		return this.createUserId;
	}

	public void setCreateUserId(Integer createUserId) {
		this.createUserId = createUserId;
	}

	@Column(name = "create_time", length = 19)
	public Timestamp getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Timestamp createTime) {
		this.createTime = createTime;
	}

	@Column(name = "sex")
	public Integer getSex() {
		return this.sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	@ManyToMany(cascade ={CascadeType.REFRESH,CascadeType.MERGE,CascadeType.PERSIST}, fetch = FetchType.LAZY)
	@JoinTable(name = "oa_student_contract", catalog = "oa_demo", joinColumns = { @JoinColumn(name = "student_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "contract_id", nullable = false, updatable = false) })
	public List<OaContract> getOaContracts() {
		return oaContracts;
	}

	public void setOaContracts(List<OaContract> oaContracts) {
		this.oaContracts = oaContracts;
	}

	@ManyToMany(cascade ={CascadeType.REFRESH,CascadeType.MERGE,CascadeType.PERSIST}, fetch = FetchType.LAZY)
	@JoinTable(name = "oa_student_class", catalog = "oa_demo", joinColumns = { @JoinColumn(name = "student_id", updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "class_id", updatable = false) })
	public List<OaClass> getOaClasses() {
		return oaClasses;
	}

	public void setOaClasses(List<OaClass> oaClasses) {
		this.oaClasses = oaClasses;
	}

}